#!/usr/bin/perl
use ExtUtils::testlib;
use Wiimote;
print qq!
         test.pl - libwiimote perl module test application

         A    - hold to Enable accelerometer
         1    - hold to Enable rumble
         Home - Exit

        Press buttons 1 and 2 on the wiimote now to connect.
!;

my $a = new Wiimote;

print "before connect\n";
print "Connect " . $a->wiimote_connect2('00:19:1D:75:CC:30');
print "\n-------------------\n";

print "Is open: " . $a->is_open2();
print "\n-------------------\n";
while ( $a->is_open2() ) {
    $a->wiimote_update2();

    print "Wiimote Key bits: " . $a->get_wiimote_keys_bits2();
    print "\n";


}

